<div class="console-panel console-mt4 createAPI4 hide">
    <div class="console-panel-header">
        <span class="console-panel-header-line"></span>
        <div class="console-float-left ng-binding" style="font-weight: bold;">返回结果基础定义</div>
    </div>
    <div class="console-panel-body console-p4 console-pt6 console-pb6">
        <table style="width: 100%;margin-bottom: -1px;">
            <tbody>
            <tr>
                <td class="createApiResultTableTd1">返回ContentType</td>
                <td class="createApiResultTableTd2" colspan="2">
                    <select id="content-type"
                            class="form-select w-25"
                            style="width: 400px">
                        <option value="application/json;charset=UTF-8" class="ng-binding">JSON
                            (application/json;charset=UTF-8)
                        </option>
                        <option value="text/plain;charset=UTF-8" class="ng-binding">文本
                            (text/plain;charset=UTF-8)
                        </option>
                        <option value="application/octet-stream;charset=UTF-8" class="ng-binding">
                            二进制
                            (application/octet-stream;charset=UTF-8)
                        </option>
                        <option value="application/xml;charset=UTF-8" class="ng-binding">XML
                            (application/xml;charset=UTF-8)
                        </option>
                        <option value="text/html;charset=UTF-8" class="ng-binding">HTML
                            (text/html;charset=UTF-8)
                        </option>
                        <option value="custom" selected="selected" class="ng-binding">自定义
                        </option>
                    </select>
                </td>
            </tr>

            <tr id="custom-content-type-hide-show" style="display: none;">
                <td class="createApiResultTableTd1">自定义Content-Type</td>
                <td class="createApiResultTableTd2" colspan="2">
                    <input value="<#if context.api?? >${context.api.contentType!'application/json;charset=UTF-8'}</#if>"
                           class="form-control w-25 ng-valid-pattern"
                           id="custom-content-type" type="text"
                           placeholder="请输入自定义返回类型值">
                </td>
            </tr>

            <tr>
                <td class="createApiResultTableTd1">透传header值</td>
                <td class="createApiResultTableTd2 result-tran-header-body" colspan="2">
                    <div>
                        <input type="text"
                               class="form-control w-25 input-result-header-name"
                               placeholder="请输入header名字">
                        <a style="white-space:nowrap"><span style='cursor:pointer;' class="" onclick='addResultHeader()'>增加一条</span></a>
                    </div>
                    <#if context.api?? && context.api.result.tranHeaders?exists>
                        <#list context.api.result.tranHeaders as item>
                            <div style="margin-top: 3px;">
                                <input type="text" value="${item}"
                                       class="form-control input-result-header-name"
                                       style="width: 6rem"
                                       placeholder="请输入header名字">
                                <a style="white-space:nowrap" onclick='delResultHeader(this)'><span
                                            style='cursor:pointer;'>移除</span></a>
                            </div>
                        </#list>
                    </#if>
                </td>
            </tr>
            <tr>
                <td class="createApiResultTableTd1">访问限制返回</td>
                <td class="createApiResultTableTd2">
		                                	<textarea placeholder="请输入当访问受限制时要返回的结果"
                                                      class="form-control w-75" rows="3"
                                                      id="limitExample"><#if context.api??><#t>${context.api.result.limitExample!}<#t></#if></textarea>
                </td>
                <td>状态码 <input style="width:160px;"
                                  value="<#if context.api??>${context.api.result.limitStatus?c}</#if>"
                                  class="form-control w-25"
                                  id="limitStatus" type="text" placeholder="请输入状态码,默认202">
                </td>
            </tr>
            <tr>
                <td class="createApiResultTableTd1">发生异常/失败返回</td>
                <td class="createApiResultTableTd2">
		                                	<textarea placeholder="请输入当发生了异常要返回的结果"
                                                      class="form-control w-75" rows="3"
                                                      id="failureExample"><#if context.api??><#t>${context.api.result.failureExample!}<#t></#if></textarea>
                </td>
                <td>状态码 <input style="width:160px;"
                                  value="<#if context.api??>${context.api.result.failureStatus?c}</#if>"
                                  class="form-control w-25"
                                  id="failureStatus" type="text" placeholder="请输入状态码,默认500">
                </td>
            </tr>
            <tr>
                <td class="createApiResultTableTd1">网关入口参数检查失败返回</td>
                <td class="createApiResultTableTd2">
		                                	<textarea placeholder="请输入网关入口参数检查失败要返回的结果"
                                                      class="form-control w-75" rows="3"
                                                      id="apiEnterCheckFailureExample"><#if context.api??><#t>${context.api.result.apiEnterCheckFailureExample!}<#t></#if></textarea>
                </td>
                <td>状态码 <input style="width:160px;"
                                  value="<#if context.api??>${context.api.result.apiEnterCheckFailureStatus?c}</#if>"
                                  class="form-control w-25"
                                  id="apiEnterCheckFailureStatus" type="text"
                                  placeholder="请输入状态码,默认400"></td>
            </tr>
            <tr>
                <td class="createApiResultTableTd1">无法连接上后台服务器返回</td>
                <td class="createApiResultTableTd2">
		                                	<textarea placeholder="请输入网关无法连接上后台服务器时的返回结果"
                                                      class="form-control w-75" rows="3"
                                                      id="cantConnServerExample"><#if context.api??><#t>${context.api.result.cantConnServerExample!}<#t></#if></textarea>
                </td>
                <td>状态码 <input style="width:160px;"
                                  value="<#if context.api??>${context.api.result.cantConnServerStatus?c}</#if>"
                                  class="form-control w-25"
                                  id="cantConnServerStatus" type="text"
                                  placeholder="请输入状态码,默认504"></td>
            </tr>
            <tr>
                <td class="createApiResultTableTd1">返回结果示例</td>
                <td class="createApiResultTableTd2">
		                                	<textarea placeholder="该值只作为展示如果操作成功返回值的例子,没有实际作用"
                                                      class="form-control w-75" rows="3"
                                                      id="successExample"><#if context.api??><#t>${context.api.result.successExample!}<#t></#if></textarea>
                </td>
            </tr>
            </tbody>
        </table>
    </div>

    <div class="console-panel console-mt4 mt-4">
        <div class="console-panel-header">
            <span class="console-panel-header-line"></span>
            <div class="console-float-left ng-binding" style="font-weight: bold;">
                接口返回错误码定义
            </div>
        </div>

        <div class="api-param-map-setter ms3">
            <table>
                <tbody>
                <tr>
                    <th width="25%" class="ng-binding">错误码</th>
                    <th width="25%" class="ng-binding">错误信息</th>
                    <th width="35%" class="ng-binding">描述</th>
                    <th width="10%" class="ng-binding">操作</th>
                </tr>
                <#if context.api?? && context.api.result.status?exists>
                    <#list context.api.result.status as item>
                        <tr class="ng-scope">
                            <td><input value="${item.code!}" placeholder="必填: 请输入状态码"
                                       class="form-control w-25">
                            </td>
                            <td><input value="${item.msg!}" placeholder="必填: 请输入错误信息"
                                       class="form-control w-25">
                            </td>
                            <td><input value="${item.describe!}" placeholder="必填: 请输入错误描述"
                                       class="form-control w-25">
                            </td>
                            <td><a class=""><span onclick='delParam(this)' style='cursor:pointer;'>移除</span></a>
                            </td>
                        </tr>
                    </#list>
                </#if>
                </tbody>
            </table>
        </div>
        <div class="pagination-gird-container request-param-setter-errormessage ng-binding ng-hide">
            <i class="icon-no-2 console-mr1 console-inline-block"></i>
        </div>
        <div class="console-clearfix" style="padding-bottom: 10px; padding-top: 10px;">
                                    <span class="console-button-wrap ng-isolate-scope" theme="green" size="tiny"
                                          icon="add">
                                        <a class="console-button console-button-green console-button-tiny errParam">
                                            <i class="icon-add"></i>
                                            <span>
                                                <span class="ng-scope ng-binding">增加一条</span>
                                            </span>
                                        </a>
                                    </span>
        </div>
    </div>
</div>